package com.guigu.order.feign;


import com.guigu.base.entity.CoreOrg;
import com.guigu.base.entity.GlobalUser;
import com.guigu.base.entity.GoodsType;
import com.guigu.base.entity.dto.AgencyScopeDto;
import com.guigu.base.entity.dto.CourierScopDto;
import com.guigu.tms.result.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
import com.guigu.base.entity.CoreOrg;
import com.guigu.base.entity.GlobalUser;
import com.guigu.base.entity.GoodsType;
import com.guigu.base.entity.dto.AgencyScopeDto;
import com.guigu.base.entity.dto.CourierScopDto;
import java.util.List;

/**
 * @ClassName:GoodsTypeFeign
 * @Description://TODO
 * @Author:taoLong
 * @Date:2021/11/15:16:27 星期一
 * @email:2391611102@qq.com or 2391611102qq@gmail.com
 */
@FeignClient(value = "service-base")
public interface BaseFeign {


    /**
     * 获取货物类型信息
     *
     * @return
     */
    @ApiOperation("获取货物类型信息")
    @GetMapping("/goods/pd-goods-type/")
    public R<List<GoodsType>> getGoodsType();


    /**
     * 根据id查询货物类型
     *
     * @param id
     * @return
     */
    @GetMapping("/goods/pd-goods-type/{id}")
    public R<GoodsType> getById(@PathVariable("id") String id);

    /**
     * 根据机构id查找机构范围数据
     *
     * @param agencyId
     * @return
     */
    @ApiOperation("根据机构id查找机构范围数据")
    @GetMapping("/base/pd-courier-scop/findByAgencyScopeId/{agencyId}")
    public R<AgencyScopeDto> findByAgencyScopeId(@PathVariable("agencyId") String agencyId);


    /**
     * 获取快递员业务范围列表
     *
     * @param areaId 行政区域id
     * @param userId 快递员id
     * @return 快递员业务范围列表
     */
    @GetMapping("/base/pd-courier-scop/courier")
    @ApiOperation("获取快递员业务范围列表")
    public R<List<CourierScopDto>> findAllCourierScope(@RequestParam(name = "areaId", required = false) String areaId, @RequestParam(name = "userId", required = false) String userId);


    /**
     * 根据id查找组织机构信息
     *
     * @param id
     * @return
     */
    @ApiOperation("根据id查找组织机构信息")
    @GetMapping("/base/core-org/{id}")
    public R<CoreOrg> findById(@PathVariable("id") String id);

    /**
     * 根据快递员Id查询其员工信息
     *
     * @param courierId
     * @return
     */
    @ApiOperation("根据快递员Id查询其员工信息")
    @GetMapping("/base/global-user/queryAccordingToTheCourierId/{courierId}")
    public GlobalUser queryAccordingToTheCourierId(@PathVariable("courierId") String courierId);
}
